3.3 \(\int x (a+b \tan (c+d x^2)) \, dx\)

Optimal. Leaf size=26 \[ \frac{a x^2}{2}-\frac{b \log \left (\cos \left (c+d x^2\right )\right )}{2 d} \]

[Out]

(a*x^2)/2 - (b*Log[Cos[c + d*x^2]])/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0258382, antiderivative size = 26, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.214, Rules used = {14, 3747, 3475} \[ \frac{a x^2}{2}-\frac{b \log \left (\cos \left (c+d x^2\right )\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[x*(a + b*Tan[c + d*x^2]),x]

[Out]

(a*x^2)/2 - (b*Log[Cos[c + d*x^2]])/(2*d)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3747

Int[(x_)^(m_.)*((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Tan[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int x \left (a+b \tan \left (c+d x^2\right )\right ) \, dx &=\int \left (a x+b x \tan \left (c+d x^2\right )\right ) \, dx\\ &=\frac{a x^2}{2}+b \int x \tan \left (c+d x^2\right ) \, dx\\ &=\frac{a x^2}{2}+\frac{1}{2} b \operatorname{Subst}\left (\int \tan (c+d x) \, dx,x,x^2\right )\\ &=\frac{a x^2}{2}-\frac{b \log \left (\cos \left (c+d x^2\right )\right )}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.0180102, size = 26, normalized size = 1. \[ \frac{a x^2}{2}-\frac{b \log \left (\cos \left (c+d x^2\right )\right )}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*Tan[c + d*x^2]),x]

[Out]

(a*x^2)/2 - (b*Log[Cos[c + d*x^2]])/(2*d)

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 30, normalized size = 1.2 \begin{align*}{\frac{a{x}^{2}}{2}}-{\frac{b\ln \left ( \cos \left ( d{x}^{2}+c \right ) \right ) }{2\,d}}+{\frac{ac}{2\,d}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*tan(d*x^2+c)),x)

[Out]

1/2*a*x^2-1/2*b*ln(cos(d*x^2+c))/d+1/2/d*a*c

________________________________________________________________________________________

Maxima [A]  time = 1.04563, size = 30, normalized size = 1.15 \begin{align*} \frac{1}{2} \, a x^{2} + \frac{b \log \left (\sec \left (d x^{2} + c\right )\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x^2+c)),x, algorithm="maxima")

[Out]

1/2*a*x^2 + 1/2*b*log(sec(d*x^2 + c))/d

________________________________________________________________________________________

Fricas [A]  time = 1.6185, size = 72, normalized size = 2.77 \begin{align*} \frac{2 \, a d x^{2} - b \log \left (\frac{1}{\tan \left (d x^{2} + c\right )^{2} + 1}\right )}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x^2+c)),x, algorithm="fricas")

[Out]

1/4*(2*a*d*x^2 - b*log(1/(tan(d*x^2 + c)^2 + 1)))/d

________________________________________________________________________________________

Sympy [A]  time = 0.292229, size = 36, normalized size = 1.38 \begin{align*} \begin{cases} \frac{a x^{2}}{2} + \frac{b \log{\left (\tan ^{2}{\left (c + d x^{2} \right )} + 1 \right )}}{4 d} & \text{for}\: d \neq 0 \\\frac{x^{2} \left (a + b \tan{\left (c \right )}\right )}{2} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x**2+c)),x)

[Out]

Piecewise((a*x**2/2 + b*log(tan(c + d*x**2)**2 + 1)/(4*d), Ne(d, 0)), (x**2*(a + b*tan(c))/2, True))

________________________________________________________________________________________

Giac [A]  time = 1.18515, size = 38, normalized size = 1.46 \begin{align*} \frac{{\left (d x^{2} + c\right )} a - b \log \left ({\left | \cos \left (d x^{2} + c\right ) \right |}\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*tan(d*x^2+c)),x, algorithm="giac")

[Out]

1/2*((d*x^2 + c)*a - b*log(abs(cos(d*x^2 + c))))/d